package de.java.shortys.myhome.viewconfigurator.controller;

import java.awt.Color;
import java.util.ResourceBundle;

public class ViewConfigurationManager {

	private String name;

	private static ViewConfigurationManager instance;

	private ResourceBundle bundle;

	public static ViewConfigurationManager getInstance() {
		if (instance == null) {
			instance = new ViewConfigurationManager();
		}
		return instance;
	}

	public static Color getTransparency() {
		return new Color(0, 0, 0, 0);
	}

	public ViewConfigurationManager() {
		this.name = "de/java/shortys/myhome/viewconfigurator/configuration/ViewConfiguration";
		initialize();
	}

	private void initialize() {
		bundle = ResourceBundle.getBundle(name);

	}

	public Color getColor(String key) {
		return Color.decode("0x" + get(key));
	}

	public Integer getInteger(String key) {
		return Integer.parseInt(get(key));
	}

	public String get(String key) {
		return bundle.getString(key);
	}

}
